function PlotCompaction( csrBytes, totCompact, idxCompact, nnzCompact, params, epsName )

   figure;
   grid on;
   hold on;
   
   axlims = axis;
   ymin = -2;
   ymax = 14;
   xmin = 5.75; % 5;
   xmax = 9;
   axlims(1) = xmin;
   axlims(2) = xmax;
   axlims(3) = ymin;
   axlims(4) = ymax;
   axis( axlims );
   
   xticks = {};
   yticks = {};
   set( gca, 'XTick', ceil( xmin ):1:floor( xmax ) );
   set( gca, 'YTick', ymin:2:ymax );
   xtickv = get( gca, 'XTick' );
   ytickv = get( gca, 'YTick' );
   for i = 1:length( xtickv )
      xv = 10^xtickv( i );
      if xv < 1e3
         mtag = '';
         mval = 1;
      elseif xv < 1e6
         mtag = 'K';
         mval = 1e3;
      elseif xv < 1e9
         mtag = 'M';
         mval = 1e6;
      elseif xv < 1e12
         mtag = 'B';
         mval = 1e9;
      else
         assert 0;
      end
      
      xv = xv / mval;
      xticks{ end+1 } = sprintf( '%d%s', round( xv ), mtag );
   end
   for i = 1:length( ytickv )
      yv =  2^ytickv( i );
      if yv < 1
         yticks{ end+1 } = sprintf( '%.2fx',  yv );
      else
         yticks{ end+1 } = sprintf( '%dx',  round( yv ) );
      end
   end
   
   set( gca, 'XTickLabel', xticks );
   set( gca, 'YTickLabel', yticks );
   
   x0 = 10^min( axlims(1) );
   x1 = 10^max( axlims(2) );
   y0 = 1;
   y1 = 1;
   xbase = [ x0 x1 ];
   ybase = [ y0 y1 ];
   
   idxs = 1:1:length( csrBytes );
   
   % make the plot
   for idx = idxs
      xv0 = log10( csrBytes( idx ) );
      xv1 = log10( csrBytes( idx ) );
      yv0 = log2( idxCompact( idx ) );
      yv1 = log2( nnzCompact( idx ) );
      xline = [ xv0 xv1 ];
      yline = [ yv0 yv1 ];
      plot( xline, yline, 'k', 'LineWidth', 1, 'HandleVisibility', 'off' );
   end
   
   plot( log10( xbase ), log2( ybase ), 'k', 'LineWidth', params.lineWidth, 'HandleVisibility', 'off' );
   plot( log10( csrBytes( idxs ) ), log2( totCompact( idxs ) ), params.markers{ 1 }, 'MarkerSize', params.mrkSize, 'MarkerEdgeColor', params.colors( 1, : ), 'MarkerFaceColor', params.colors( 1, : ) );
   plot( log10( csrBytes( idxs ) ), log2( idxCompact( idxs ) ), params.markers{ 2 }, 'MarkerSize', params.mrkSize, 'MarkerEdgeColor', params.colors( 4, : ), 'MarkerFaceColor', params.colors( 4, : ) );
   plot( log10( csrBytes( idxs ) ), log2( nnzCompact( idxs ) ), params.markers{ 3 }, 'MarkerSize', params.mrkSize, 'MarkerEdgeColor', params.colors( 7, : ), 'MarkerFaceColor', params.colors( 7, : ) );
   
   legend( 'overall', 'indices', 'non-zeros', 'Location', 'NorthWest' );
   xlabel( '$bytes_{CSR}$',                                       'interpreter', 'latex', 'FontWeight', 'bold', 'FontSize', params.fontSize+0 );
   ylabel( '$\frac{bytes_{CSR}\mbox{  }}{bytes_{DAG}\mbox{  }}$', 'interpreter', 'latex', 'FontWeight', 'bold', 'FontSize', params.fontSize+1 );
   
   print( gcf, '-depsc2', epsName );
end

